// +build windows

package main

import (
	"errors"
	"os"
	"os/signal"
	"syscall"
)

func GetExitAction() func() {
	return func() {
		os.Exit(1)
	}
}

func GetRestartAction() func() {
	return func() {
		os.Exit(1)
	}
}

func Wait() error {
	term_sys := make(chan os.Signal)
	//forked := false
	signal.Notify(term_sys, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGINT)
	for {
		sig := <-term_sys
		switch sig {
		case syscall.SIGQUIT:
			log.Info("Received SIGQUIT, exiting..")
		default:
			log.Info("Received SIGTERM, exiting gracefully...")
			return nil
		}
	}
}

func KillParent(ppid int) error {
	//return syscall.Kill(ppid, syscall.SIGQUIT)
	os.Exit(1)
	return nil
}
func KillSelf(pid int, sig syscall.Signal) error {
	os.Exit(1)
	return nil
}

func ReadTcpFile() ([]byte, error) {
	return nil, errors.New("windows no file")
}
